package org.testis.webautomationmodule.ui.objects;

import org.testis.webautomationmodule.ui.UIFormFieldDecorator;


public class UIButton extends UIFormFieldDecorator
{

    public UIButton(String id)
    {
        super(id);
    }


    public UIButton(String id,
                    String value)
    {
        super(id,
              value);
    }


    @Override
    protected boolean setBehavior()
    {
        if (checkAvailableForAction()) {
            getWebAutomationImpl().click(getId());
            putLog(" Clicking button with id " + getId());
            return true;
        }

        return false;
    }


    @Override
    public boolean verifyBehavior()
    {
        return setBehavior();
    }


    @Override
    public boolean getBehavior()
    {
        return setBehavior();
    }
}

